<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: 梁家源
  Date: 2021/4/5
  Time: 23:30
  To change this template use File | Settings | File Templates.
  本页面专用来展示【管理员】对订单的操作结果
--%>

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <link rel="stylesheet" type="text/css"
          href="${pageContext.request.contextPath}/static/layui-v2.5.7/layui/css/layui.css"/>
    <script src="${pageContext.request.contextPath}/static/layui-v2.5.7/layui/layui.js" type="text/javascript"
            charset="UTF-8"></script>
    <script src="${pageContext.request.contextPath}/static/script/jquery-1.7.2.js" type="text/javascript"
            charset="UTF-8"></script>
</head>
<script>
    layui.use('form', function () {
        var form = layui.form;
    });

</script>
<body>
<fieldset class="layui-elem-field layui-field-title" style="margin: 20px" >
    <legend style="margin-left: 50px;">订单管理</legend>
</fieldset>
<div class="layui-container">
    <div class="layui-row">
            <form class="layui-form" action="${pageContext.request.contextPath}/queryOrderByAdmin" method="post">
                <div class="layui-form-item">
                    <div class="layui-input-inline" style="width: 220px">
                        <input type="text" name="id" required  lay-verify="required" placeholder="请输入要查寻订单的相关信息" autocomplete="off" class="layui-input">
                    </div>
                    <div class="layui-input-inline" >
                        <select name="queryType" lay-verify="required">
                            <option value="orderId" selected>订单号查询</option>
                            <option value="userId">用户id查询</option>
                            <option value="buyerId">买方id查询</option>
                            <option value="sellerId">卖方id查询</option>
                        </select>
                    </div>
                    <div class="layui-input-inline" >
                        <button class="layui-btn layui-btn-radius" title="搜索" lay-submit lay-filter="formDemo">
                            <i class="layui-icon">&#xe615;</i>
                        </button>
                    </div>
                </div>
            </form>
    </div>

    <div class="layui-row">
        <table class="layui-table" lay-skin="nob">
            <colgroup>
                <col width="80px"><!--序号-->
                <col width="150px"><!--订单号-->
                <col width="150px"><!--买方ID-->
                <col width="150px"><!--卖方ID-->
                <col width="200px"><!--商品名称-->
                <col width="150px"><!--交易时间-->
                <col width="150px"><!--订单状态-->
                <col width="140px"><!--交易金额-->
                <col>
            </colgroup>
            <thead>
            <tr>
                <th>序号</th>
                <th>订单号</th>
                <th>买方ID</th>
                <th>卖方ID</th>
                <th>商品名称</th>
                <th>交易时间</th>
                <th>订单状态</th>
                <th>交易金额</th>
                <th>操 作</th>
            </tr>
            </thead>
            <tbody>
            <c:forEach var="order" varStatus="status" items="${orderList}">
                <tr>
                    <th>${status.count}</th>
                    <th>${order.oid}</th>
                    <th>${order.obid}</th>
                    <th>${order.osid}</th>
                    <th>${order.ogname}</th>
                    <th>${order.otime}</th>
                    <th>${order.ostatus}</th>
                    <th>${order.oprice}</th>
                    <td>
                        <a href="${pageContext.request.contextPath}/deleteOrderByAdmin?oid=${order.oid}">
                            <button type="button" class="layui-btn layui-btn-sm layui-btn-radius" title="删除">
                                <i class="layui-icon">&#xe640;</i>
                            </button>
                        </a>
                    </td>
                </tr>
            </c:forEach>
            </tbody>



        </table>
    </div>





</div>
</body>
